import { defineStore } from 'pinia'

export const useUserStore = defineStore({
    id: 'user',
    state: () => {
        return {
           userInfo  : {
            expire: '',
            key: '',
           },
           token: '',
           pcInfo : {
                choseList: [],
           }
        }
    },
    actions: {
        setToken (token:string) {
            this.token = token
        },
        setInfo (item:any) {
            this.pcInfo = item
        },
        setUser (item) {
            this.userInfo = {...item}
        },
        clear () {
            this.userInfo = {
                expire: '',
                key: '',
                token: '',
            }
        }
    },
    
    getters: {
      
    }

})
